package com.example.my.agiftthat.MvpActivity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;

import com.example.my.agiftthat.R;

import java.util.Timer;
import java.util.TimerTask;

public class MainActivityWelcome extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main_welcome);
        //欢迎引导页跳转
        initIntent();
    }

    private void initIntent() {
        //设置跳转的对象
        final Intent intent = new Intent(this, MainActivity.class);
        //设置停留时间
        Timer timer = new Timer();
        TimerTask task = new TimerTask() {
            @Override
            public void run() {
                //跳转
                startActivity(intent);
                //清除activity
                MainActivityWelcome.this.finish();
            }
        };
        //设置停留时间
        timer.schedule(task, 3000);
    }
}
